<template>
  <div class="mod-config">
    <table-view ref="view"
                :searchAttrs="searchAttrs"
                :primaryKey="primaryKey"
                :listApiName="listApiName"
                :deleteApiName="deleteApiName"
                :saveAuthName="saveAuthName"
                :deleteAuthName="deleteAuthName"
                :exportApiName="exportApiName"
                :showAttrs="showAttrs"
    >
    </table-view>

    <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
  </div>
</template>


<script>
  import tableView from '@/components/tableView'
  import basicMixins from '@/utils/commonViewMixins'
  import AddOrUpdate from './weighdetailinfo-add-or-update'

  export default {
    mixins: [basicMixins],
    data() {
      return {
        primaryKey: 'id',
        listApiName: 'weighApi/listWeighDetailInfoList',
        deleteApiName: 'weighApi/deleteWeighDetailInfo',
        saveAuthName: 'weigh:weighdetailinfo:save',
        deleteAuthName: 'weigh:weighdetailinfo:delete',
        exportApiName: 'weighApi/exportWeighDetailInfoList',
        searchAttrs: {
          clientId: {
            label: "收货单位",
            placeholder: "请输入收货单位",
            type: 'autoComplete',
            querySearchApiName: 'clientApi/getClientList'
          },
          dateTimeRange: {
            type: 'date',
            label: '时间范围',
            dateType: 'datetimerange',
            defaultTime: ['06:00:00', '08:00:00'],
            clearable: true
          },
          // sysDictId: {
          //   label: "货物名称",
          //   placeholder:"请输入货物名称",
          //   type: 'autoComplete',
          //   querySearchApiName: 'systemApi/getSysDictInfoList'
          // },

          // driverId: {
          //   label: "驾驶员",
          //   placeholder:"请输入驾驶员姓名",
          //   type: 'autoComplete',
          //   querySearchApiName: 'driverApi/getDriverInfoList'
          // }
        },
        showAttrs: {
          weighDetailNo: {
            label: "记录单号",
            width: 140
          },

          licensePlateNo: {
            label: "车牌",
            width: 100
          },
          planOrderId: {
            label: "产品出库单号",
            width: 160
          },
          sysDictName: {
            label: "货物名称",
            width: 140
          },
          freightPaymentMethod:{
            label: "运费付费方式",
            width: 140,
            type: 'radio',
            items: [
              {value: 0, text: '本厂自付',tagType: 'primary'},
              {value: 1, text: '客户代付', tagType: 'warning'},
              {value: 2, text: '客户自付', tagType: 'success'},
              {value: 3, text: '其他', tagType: 'danger'}
            ]
          },
          freightAmountPrice:{
            label: "运费",
          },
          freightSettlementStatus:{
            label: "运费结算",
            type: 'radio',
            items: [
              {value: 0, text: '未付款',tagType: 'primary'},
              {value: 1, text: '已付款', tagType: 'success'},
              {value: 2, text: '待定', tagType: 'success'},
            ]
          },
          grossWeight: {
            label: "毛重"
          },
          tareWeight: {
            label: "皮重"
          },
          netWeight: {
            label: "净重"
          },
          entranceTime: {
            label: "入场时间",
            width: 140
          },
          leaveTime: {
            label: "出场时间",
            width: 140
          },
          driverName: {
            label: "驾驶员"
          },
          clientName: {
            label: "客户",
            type: 'linkLabel',
            routerName: 'client-clientinfo',
            searchKey: 'clientName'
          },
          supplierName: {
            label: "供应商",
            type: 'linkLabel',
            routerName: 'supplier-supplierinfo',
            searchKey: 'supplierName'
          },

          buckleWeight: {
            label: "扣重"
          },
          remark: {
            label: "备注"
          },
        }
      }
    },
    components: {
      tableView,
      AddOrUpdate
    }
  }
</script>
